package com.woniuxy.microloanserver.service.impl;

import com.woniuxy.microloanserver.bean.UserLoanInterestRateBean;
import com.woniuxy.microloanserver.bean.UserLoanQuotaInfo;
import com.woniuxy.microloanserver.dao.LoanQuotaDao;
import com.woniuxy.microloanserver.service.UserQuotaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Description: 用户贷款额度相关信息业务层接口实现类
 *
 * @Auther: HanLei
 * @Date: 2021/4/16:10:17
 */
@Slf4j
@Service
public class UserQuotaServiceImpl implements UserQuotaService {

    @Resource
    private LoanQuotaDao userLoanDao;

    @Override
    public UserLoanQuotaInfo getUserLoanQuota(Integer userId) {
        return userLoanDao.qureyQuotaByUserId(userId);
    }

    @Override
    public int addQuota(UserLoanQuotaInfo userLoanQuotaInfo) {
        return userLoanDao.addQuota(userLoanQuotaInfo);
    }

    @Override
    public int addUserRate(UserLoanInterestRateBean userLoanInterestRateBean) {
        return userLoanDao.addUserRate(userLoanInterestRateBean);
    }

    @Override
    public int update(UserLoanQuotaInfo userLoanQuotaInfo) {
        return userLoanDao.update(userLoanQuotaInfo);
    }
}
